function slowtwoshift(funct,N,D1,D2,M,eps1,eps2)
% slowtwoshift(funct,N,D1,D2,M,eps1,eps2)
% 	Parameters:
% 		funct:	the function used to create a time series
% 		N:	number of elements in the time series
% 		D1:	initial displacement
% 		D2:	second displacement
% 		M:	kernel length
% 		eps1:	initial perturbation
% 		eps2:	second perturbation
% 	Outputs:
% 		Only the plots produced by this function
% 	Purpose of this code:
% 		This is a test designed to produce two suppression plots... One involving the "two shift test" using one filter at each time step
% 		The other is for the "two shift test" with out a perturbation.


hold off;

mesh = 1:N;
ts = funct(mesh);
ts = lowpass(ts);

ts1 = slowshift(ts,D1,M,eps1);
ts2 = slowshift(ts1,D2,M,eps2);

D = D1 + D2;
eps = eps1 + eps2;

tss = slowshift(ts,D,M,eps);

[psorig,freq] = mypsd(ts);
err = abs(ts2-tss);
errps = mypsd(err);
suppr = sqrt(psorig./errps);
figure;
loglog(freq,suppr,'r');
hold on;

tss1 = FDtest(ts,D1,M);
tss2 = FDtest(tss1,D2,M);

tsss = FDtest(ts,D,M);

errs = abs(tss2-tsss);
errpss = mypsd(errs);
supprs = sqrt(psorig./errpss);
loglog(freq,supprs,'g');


end

